package com.lnking.lnkingplace.controller;

import com.lnking.common.http.ReturnResult;
import com.lnking.lnkingplace.model.request.isolation.statistics.StatisticsSearchPersonnelType;
import com.lnking.lnkingplace.service.IIsolationPlaceStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/isolation-place-statistics")
@Api(tags = "隔离场所驾驶舱")
public class IsolationPlaceStatisticsController {

    @Resource
    IIsolationPlaceStatisticsService iIsolationPlaceStatistics;

    @GetMapping("get-isolation-place-info")
    @ApiOperation("获取已启用隔离场所信息")
    public ReturnResult getIsolationPlaceInfo(String placeName){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationPlaceInfo(placeName));
    }

    @GetMapping("get-relieve-data")
    @ApiOperation("(新)-解除隔离人员")
    public ReturnResult getRelieveData(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getRelieveData(street));
    }

    @GetMapping("get-personnel-type")
    @ApiOperation("(新)-隔离人员一级弹窗")
    public ReturnResult getPersonnelType(StatisticsSearchPersonnelType params){
        return ReturnResult.success(iIsolationPlaceStatistics.getPersonnelType(params));
    }

    @GetMapping("get-isolation-personnel")
    @ApiOperation("隔离人员数据")
    public ReturnResult getIsolationPersonnel(){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationPersonnel());
    }

    @ApiOperation("隔离人员类型(环形图)")
    @GetMapping("get-personnel-pie-chart")
    public ReturnResult getPersonnelPieChart(String today,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getPersonnelPieChart(today,street));
    }

    @ApiOperation("累计阳性和复阳病例")
    @GetMapping("get-positive-count")
    public ReturnResult getPositiveCount(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getPositive(street));
    }

    @ApiOperation("累计阳性(环形图)")
    @GetMapping("get-positive-pie-chart")
    public ReturnResult getPositivePieChart(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getPositivePieChart(street));
    }

    @ApiOperation("累计复阳(环形图)")
    @GetMapping("get-after-positive-pie-chart")
    public ReturnResult getAfterPositivePieChart(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getAfterPositivePieChart(street));
    }

    @GetMapping("get-isolation-room")
    @ApiOperation("隔离房间数据")
    public ReturnResult getIsolationRoom(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationRoom(street));
    }

    @GetMapping("get-isolation-worker")
    @ApiOperation("隔离场所专班人员")
    public ReturnResult getIsolationWorker(String placeName,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationWorker(placeName,street));
    }

    @GetMapping("get-isolation-worker-pie-chart")
    @ApiOperation("隔离场所专班人员(环形图)")
    public ReturnResult getIsolationWorkerPieChart(String placeName,String camp,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationWorkerPieChart(placeName,camp,street));
    }

    @GetMapping("get-support-occupancy-total")
    @ApiOperation("支援区外隔离保障场所(环形图)-累计入住人数")
    public ReturnResult getSupportOccupancyTotal(String placeName,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getSupportOccupancyTotal(placeName,street));
    }

    @GetMapping("get-support-occupancy-number")
    @ApiOperation("支援区外隔离保障场所(环形图)-在住人数")
    public ReturnResult getSupportOccupancyNumber(String placeName,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getSupportOccupancyNumber(placeName,street));
    }

    @GetMapping("get-support-day-new-number")
    @ApiOperation("支援区外隔离保障场所(环形图)-当日新增")
    public ReturnResult getSupportDayNewNumber(String placeName,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getSupportDayNewNumber(placeName,street));
    }

    @GetMapping("get-support-use-room")
    @ApiOperation("支援区外隔离保障场所(环形图)-已使用房间数")
    public ReturnResult getSupportUseRoom(String placeName,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getSupportUseRoom(placeName,street));
    }

    @GetMapping("get-isolation-assistance")
    @ApiOperation("关心关爱台账(记录总数/已解决个数)")
    public ReturnResult getIsolationAssistance(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationAssistance(street));
    }

    @GetMapping("get-isolation-assistance-type")
    @ApiOperation("关心关爱台账(人员类型)")
    public ReturnResult getIsolationAssistanceType(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationAssistanceType(street));
    }

    @GetMapping("get-place-problem")
    @ApiOperation("问题整改台账")
    public ReturnResult getPlaceProblem(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getPlaceProblem(street));
    }

    @GetMapping("get-history-data")
    @ApiOperation("历史累计数据")
    public ReturnResult getHistoryData(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getHistoryData(street));
    }

//    @GetMapping("get-history-eq-data")
//    @ApiOperation("历史累计数据(精准查询)")
//    public ReturnResult getHistoryEqData(String street,@RequestParam String date){
//        return ReturnResult.success(iIsolationPlaceStatistics.getHistoryEqData(street,date));
//    }

    @GetMapping("get-place-plan")
    @ApiOperation("集中隔离场所统筹调度")
    public ReturnResult getPlacePlan(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getPlacePlan(street));
    }

    @GetMapping("get-isolation-place-reserve")
    @ApiOperation("场所储备(隔离场所)")
    public ReturnResult getIsolationPlaceReserve(String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getIsolationPlaceReserve(street));
    }

    @GetMapping("get-place-reserve")
    @ApiOperation("场所储备(保转运/保供应场所)")
    public ReturnResult getPlaceReserve(String placeType,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getPlaceReserve(placeType,street));
    }

    @GetMapping("get-line-chart")
    @ApiOperation("隔离场所运行趋势")
    public ReturnResult getLineChart(@RequestParam("type") String type,String street){
        return ReturnResult.success(iIsolationPlaceStatistics.getLineChart(type,street));
    }
}
